package com.example.demo.service;

import javax.annotation.PostConstruct;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

@Component
@RefreshScope
public class DemoDService implements InitializingBean, InstantiationAwareBeanPostProcessor {
	public DemoDService() {
		System.out.println("demo d service init");
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		//System.out.println("afterPropertiesSet");
	}

	@PostConstruct
	public void init() {
		System.out.println("init PostConstruct");
	}

	public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException {
		//System.out.println("postProcessAfterInstantiation");
		return true;
	}
	
	public void test() {
		System.out.println("test");
	}
	
//	@Override
//	public PropertyValues postProcessProperties(PropertyValues pvs, Object bean, String beanName)
//			throws BeansException {
//		System.out.println("postProcessProperties");
//		return null;
//	}
}
